home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-18 | 1.1 KB | 55 lines | [TEXT/MPS ] |
- #include <files.h>
- #include "volumeinfo.h"
- #include "specs.h"
-
- #define parentofroot 0
-
- extern OSErr rootfsspec( const Str31& name,
- FSSpec& root )
- {
- volumeinfo info(name);
- OSErr error= info.whatiswrong();
- if ( error != noErr )
- return error;
-
- return FSMakeFSSpec( info.refnum(),
- parentofroot,
- (ConstStr255Param)&name,
- &root );
- }
-
- extern OSErr rootfsspec( int16 vrefnum,
- FSSpec& root )
- {
- volumeinfo info(vrefnum);
- OSErr error= info.whatiswrong();
- if ( error != noErr )
- return error;
-
- return FSMakeFSSpec( info.refnum(),
- parentofroot,
- (ConstStr255Param)&info.name(),
- &root );
- }
-
- extern OSErr childfsspec( const FSSpec& parent,
- const Str255& name,
- FSSpec& child )
- {
- CInfoPBRec pb;
- pb.dirInfo.ioCompletion = 0;
- pb.dirInfo.ioNamePtr = (StringPtr)&parent.name;
- pb.dirInfo.ioFDirIndex = 0;
- pb.dirInfo.ioVRefNum= parent.vRefNum;
- pb.dirInfo.ioDrDirID= parent.parID;
-
- OSErr error= PBGetCatInfoSync( &pb );
- if (error != noErr)
- return error;
-
- return FSMakeFSSpec( parent.vRefNum,
- pb.dirInfo.ioDrDirID,
- (ConstStr255Param)&name,
- &child );
- }
-